Download Go Source Code & Other Scripts

For source code & scripts, download and extract file go-protobuf-grpc-resources.zip from this lecture's resource


Slides

For certain reason, the slides is not available for download. I'm sorry for the inconvenience.


Install Chocolatey (for Windows)

See installation instruction here


Install Brew (for Mac)

See installation instruction here


Adding PATH variable

Windows

  1. Open Windows Start menu, search for Environment Variables and select Edit the system environment variables.

  2. In the System Properties window, click the Environment Variables button

  3. In the Environment Variables window, scroll down to the System variables section and find the PATH variable. Select it and click the Edit button

  4. Click the New button and enter the path to the folder you want to add to the PATH variable

  5. Click OK to close all windows and apply the changes

  6. Restart terminal / command prompt


Mac with zsh

  1. Open the Terminal application

  2. In the Terminal , type the following command and press Enter to open the zsh configuration file:

    nano ~/.zshrc
  3. In the nano editor, add the following line at the end of the file, replacing /path/to/your/folder with the actual path to the folder you want to add to the PATH variable:

    export PATH=$PATH:/path/to/your/folder
  4. Press Control + X, then Y, then Enter / Return to save the changes and exit the editor.

  5. To activate the new PATH variable, restart terminal.


Linux with bash shell

  1. Open a terminal window

  2. Open the .bashrc file by typing the following command and pressing Enter:

    nano ~/.bashrc
  3. Add the following line at the end of the file, replacing /path/to/your/folder with the actual path to the folder you want to add to the PATH variable:

    export PATH=$PATH:/path/to/your/folder
  4. Press Control + X, then Y, then Enter to save the changes and exit the editor.

  5. To activate the new PATH variable, restart terminal.


Rules for Protocol Buffers Schema Evolution

Here are some general rules for ensuring schema compatibility during schema evolution:

  1. Never modify the field number of an existing field. Field numbers are used to identify fields in the encoded data, and changing them can cause compatibility issues.

  2. Never delete an existing field. Instead, mark the field as deprecated and use the reserved keyword to prevent the field number from being reused in the future.

  3. Never change the data type of an existing field. For example, if a field was previously defined as a string, it should not be changed to numeric in the new schema.


Git Repository For Protocol Buffers


Git Conventional Commit

See reference here


Github Console Commands

Here are git console commands you will see throughout the course:

 

Go Console Commands

Here are the Go console commands you will see throughout the course:

Speed Up Protobuf Project Go Library

This usually required during the course if you push a new commit (on project proto) to master or main branch, and new git tag automatically created (e.g. the v0.0.12 is latest tag). Command go get -u ./... will get latest tag registered on pkg.go.dev, but it will takes some times for your latest tag to be updated there.

Instead of waiting pkg.go.dev fetch the latest tag, which can takes minutes, you can fetch the latest tag manually, and use the updated library immediately.

For example, when you need github.com/your-repository/your-proto-project with tag v0.0.12, then:

  1. Update your go.mod file manually for your protobuf library (e.g. github.com/your-repository/your-proto-project), using desired version (in this sample : v0.0.12)

  2. use this command from terminal

    go get github.com/your-repository/your-proto-project@v0.0.12


Notes:

Latest tag on pkg.go.dev for the protocol buffers repository on this course's videos (github.com/timpamungkas/my-grpc-proto) is purposedly not valid. That way, you can learn build your own protobuf repository using your own github, hence you can get maximum value from this course.


Go Database